package com.ct.gd.passport.view.widget;

import com.ct.gd.passport.R;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;


public class DefaultHeaderViewFactory {

	private LayoutInflater	mInflater;

	public DefaultHeaderViewFactory(LayoutInflater inflater) {
		super();
		this.mInflater = inflater;
	}

	/**
	 * left area default behavior is finishing the activity who host it.
	 * @param activity
	 * 
	 * @return
	 */
	public View getBackLeftView(final Activity activity) {
		View v = mInflater.inflate(R.layout.customheader_left, null);
		ImageButton btnLeft = (ImageButton) v.findViewById(R.id.btn_header_left);
		btnLeft.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				activity.finish();
			}
		});
		return v;
	}

	public View getTitleCenterView() {
		View v = mInflater.inflate(R.layout.customheader_center, null);
		return v;
	}
	
	public View getRightView() {
		View v = mInflater.inflate(R.layout.customheader_right, null);
		return v;
	}
	
}
